using System;
using System.Collections.Generic;
using System.ComponentModel;

using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CodePlex.SpaceBlock;

namespace CodePlex.SpaceBlock.UI.Controls.Explore
{
    public partial class MetadataControl : CodePlex.SpaceBlock.UI.Controls.BaseControl
    {

        public MetadataControl()
        {
            InitializeComponent();
        }

        public Metadata Metadata
        {
            get
            {
                return ((MetadataDescriptor)_grid.SelectedObject).Metadata;
            }
        }

        public void Initialize(Metadata metadata, IMetadataSuggestions suggestions)
        {
            if (metadata == null)
            {
                _grid.SelectedObject = null;
            }
            else
            {
                _grid.SelectedObject = new MetadataDescriptor(metadata, suggestions);
            }
        }

    }
}
